package com.fxnotes.page.presenter;

import com.fxnotes.Resources;
import com.fxnotes.common.ui.NodePresenter;
import com.fxnotes.domain.model.Book;
import com.fxnotes.domain.model.Chapter;
import com.fxnotes.domain.model.Page;
import com.fxnotes.page.node.PageViewNode;
import com.google.inject.Inject;
import javafx.scene.Parent;

public class PageViewPresenter extends NodePresenter<Parent> {

    private PageViewNode pageNode;

    public PageViewPresenter() {
        super(Resources.PRESENTER_PAGE_VIEW);
    }

    // API
    @Inject
    public void setNode(PageViewNode node) {
        this.pageNode = node;
    }

    @Override
    public Parent getNode() {
        return pageNode.getNode();
    }

    public void loadPage(Book book, Chapter chapter, Page page) {
        pageNode.loadPage(book, chapter, page);
    }
}
